import { defineStore } from "pinia";

export const useUserStore = defineStore("user", {
  state: () => {
    return {
      name: "",
      avatar:''
    };
  },
  //持久化储存
  persist: true,
 
 
  actions: {
    setUserInfo(value) {
      this.name = value.name;
      this.avatar = value.avatar;
    },
    clearUserInfo() {
      this.userInfo = "";
      this.avatar = '';
    },
  },
  getters: {},
  
});
